package com.javachmapi.pay.enums;

/**
 * 支付途径
 */
public enum PayWay {

	/**
	 * 付款码支付
	 * JSAPI -JSAPI支付
	 * NATIVE -Native支付
	 * APP -APP支付
	 * H5支付
	 * 小程序支付
	 * 刷脸支付
	 */

	JSAPI(1,"JSAPI"),
	NATIVE(2,"NATIVE"),
	APP(3,"APP支付"),
	H5(4,"H5支付"),
	Applet(5,"小程序支付"),
	Face(6,"刷脸支付");

	private Integer code;
	private String name;

	PayWay(Integer code, String name) {
		this.name = name;
		this.code = code;
	}

	public static String getName(Integer code,String name) {
		for (PayWay c : PayWay.values()) {
			if (c.getCode() == code) {
				return c.name;
			}
		}
		return null;
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}
